import React, { FC } from 'react'
import { ProgressCircle } from 'antd-mobile'
import useTimeDown from './TimeDown';
import PropTypes from 'prop-types'
const Dao: FC<{
    time: number,
    onEnd?: Function,
    style?: object,
    color?: string
}> = ({
    time,
    onEnd,
    style,
    color
}) => {

        const [percent] = useTimeDown(time, onEnd, time / 100)
        return (
            <div className="dao" style={style} >
                <ProgressCircle
                    percent={percent}
                    style={{
                        '--fill-color': 'var(--adm-color-danger)',
                        '--size': '180px',
                        '--track-width': '12px',
                        color: color
                    }}
                >
                    {percent} %
                </ProgressCircle>
            </div>
        )
    }

Dao.defaultProps = {
    time: 5000,
    color: '#fff'
}

export default Dao


function DaoDao() {

}